home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / declare.tex < prev    next >
Encoding:
Text File  |  1992-08-26  |  1012 b   |  33 lines

  1. % File:       TeX Inputs declare.tex
  2. % Author:     J E Pittman
  3. % Date:       September 29, 1988
  4. %
  5. % Revision 01-Jun-1990
  6. %     Changed count19 to count20 to conform to TeX 3.0
  7. %       - Neil Burleson (NABTEXM@TAMVENUS)
  8. %
  9. % These macros provide a method of locally allocating registers
  10. % without interference with previously allocated registers.  The
  11. % method is the same as on pages 346--347 of the \TeX book, however,
  12. % the declare macros are intended for local use only.  It is a logical
  13. % error to use a new macro between a declare macro and the end of the
  14. % appropriate enclosing group.
  15. %
  16. \def\declarecount {\allocate0\countdef}%
  17. \def\declaredimen {\allocate1\dimendef}%
  18. \def\declareskip  {\allocate2\skipdef}%
  19. \def\declaremuskip{\allocate3\muskipdef}%
  20. \def\declarebox   {\allocate4\chardef}%
  21. \def\declaretoks  {\allocate5\toksdef}%
  22. %
  23. \def\allocate#1#2#3{\relax
  24.    \advance\count1#1 by 1
  25.    \ifnum\count1#1<\count20
  26.    \else
  27.       \errmessage{No room for \string#3!}%
  28.    \fi
  29.    #2#3=\count1#1
  30.    }%
  31. %
  32. \endinput
  33.